<form id="form1" name="form1" method="post" action="pclass.manage.php" >
<input type="hidden" name="action" value="save" />
  <table width="680"  class="from_table">
    <tr>
      <th width="200" class="th2"><tpl> $langSysPClass </tpl>：</th>
      <td width="480" class="td1"><input name="txtPCName" type="text"  class="txtinput"id="txtPCName" value="<tpl> $pclass_array.pc_name </tpl>" />      
		<label style="display:none" for="txtPCName" class="wrong" metaDone="true" generated="true"></label>	  </td>
    </tr>
    <tr>
      <th width="200" class="th2"><tpl> $langSysPUpClass </tpl>：</th>
      <td width="480" class="td1"><div id="pclass"><tpl> $slPCUId </tpl></div></td>
    </tr>
    <tr>
      <th width="200" class="th2"><tpl> $langSysPCIntro </tpl>：</th>
      <td width="480" class="td1"><textarea name="txtPCIntro" cols="50" class="tarea" id="txtPCIntro"><tpl> $pclass_array.pc_intro </tpl></textarea>     
    	  <label style="display:none" for="txtPCIntro" class="wrong" metaDone="true" generated="true"></label>      </td>
    </tr>
	<tr>
      <th width="200" class="th2"><tpl> $langCSort </tpl>：</th>
      <td width="480" class="td1"><input name="txtSort" type="text" class="txtinput" id="txtSort" value="<tpl> $pclass_array.pc_sort|default:0 </tpl>" size="10" />
		  <label style="display:none" for="txtSort" class="wrong" metaDone="true" generated="true"></label>	  </td>
    </tr>
    <tr>
      <td width="200"></td>
      <td width="480"><span class="btn_left"><input type="submit" name="Submit" class="btn_submit" value="<tpl> $langSysPCSave </tpl>" /></span></td>
    </tr><input name="txtPCId" type="hidden" id="txtPCId" value="<tpl> $pclass_array.pc_id </tpl>" />
  </table>
</form>
<script>

$(document).ready(function() {
	hideMessage();

	<tpl> if $list_class_error != '' </tpl>
	//输出后台程序错误信息
	showMessage(<tpl> $list_class_error </tpl>,0);
	<tpl> /if </tpl>
	
	//编辑
	var options = {
		beforeSubmit:  function(){showLoading(showSaveText);},
		success:       function(msg){
			hideLoading();
			showMessage(msg.message,msg.type);
			if(msg.type == 1){
				ST(0,0);
				ShowDiv = 'result_content';
				getPageContent('pclass.manage.php?action=ajax_list');
			}
		},
		type:      'post',
		dataType:  'json'
	};

	//对添加表单做的验证定义
	
	$("#form1").validate({
		errorClass: "wrong",
		rules: {
			txtPCName: {required:true},
			txtSort: {required:true,number:true},
			txtPCIntro: {required:true}
		},
		messages: {
			txtPCName: {required: "<tpl> $langSysPleaseFillInPClass </tpl>"},
			txtSort: {required:"<tpl> $langSysPleaseFillInSort </tpl>",number:"<tpl> $langSysSortIsNumber </tpl>"},
			txtPCIntro: {required: "<tpl> $langSysPleaseFillInIntro </tpl>"}
		},
		submitHandler: function() {
			str = $('#txtPCName')[0].value;
			//$('#txtPCName').val(str.replace("+","＋"));
			//alert($('#txtPCName')[0].value);
			$('#form1').ajaxSubmit(options);
		}
	});
	//$('#form1').submit(options);
});
</script>
